﻿namespace CodeContrib
{
	public class Sorting
	{
		public string PropertyName { get; private set; }
		public SortDirection SortDirection { get; private set; }

		public Sorting(string propertyName, SortDirection sortDirection)
		{
			Guard.NotNullOrEmpty(propertyName, "propertyName");

			SortDirection = sortDirection;
			PropertyName = propertyName;
		}

		public static Sorting Ascending(string propertyName)
		{
			return new Sorting(propertyName, SortDirection.Ascending);
		}

		public static Sorting Descending(string propertyName)
		{
			return new Sorting(propertyName, SortDirection.Descending);
		}
	}
}